﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace myStuff
{
    public partial class ImageAnnotatorForm : Form
    {
        public delegate void functioncallSize(Size s);
        private event functioncallSize formFunctionPointerSize;

        public delegate void functioncallClose();
        private event functioncallClose formFunctionPointerClose;

        public string filename;
        public bool bSave = true;
        

        public ImageAnnotatorForm()
        {
            InitializeComponent();
            
            userFunctionPointer = null;

            formFunctionPointerSize += new functioncallSize(setSize);
            imageAnnotator1.userFunctionPointerSize = formFunctionPointerSize;

            formFunctionPointerClose += new functioncallClose(close);
            imageAnnotator1.userFunctionPointerClose = formFunctionPointerClose;
            DialogResult = DialogResult.Cancel;
        }

        public void close()
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        public Delegate userFunctionPointer;

        private void setSize(Size s)
        {
            s.Width += 8;
            if (s.Width < 100)
                s.Width = 100;
            s.Height += 52;
            
            this.Size = s;
        }



        private void ImageAnnotatorForm_Resize_1(object sender, EventArgs e)
        {
            imageAnnotator1.recalcSize();
        }
    }
}
